<template>
    <div>Hello World</div>
</template>

<script lang="ts" setup>
import { onMounted } from 'vue';
import auth, { LoginActions } from "../auth";
import router from '../router';

const props = defineProps<{ action: string }>();

onMounted(async () => {
    switch (props.action) {
        case LoginActions.Login:
            await auth.signIn();
            break;
        case LoginActions.LoginCallback:
            const user = await auth.completeSignIn();
            router.push('/');
            break;
        case LoginActions.LoginFailed:
            break;
    }
});
</script>
